const data = {
  date: new Date().toLocaleTimeString(),
  text: '我希望你能愉快的学习react',
  author: {
    name: 'Hello Kitty',
    avatarUrl: 'http://placekitten.com/g/64/64'
  }
};
function Comment(props) {
  console.log(props)
  return (
    <div className="Comment">
      <UserInfo author={props.author}/>
      <div className="Comment-text">
        {props.text}
      </div>
      <div className="Comment-date">
        {props.date}
      </div>
    </div>
  );
}

function Avatar(props) {
  return (
    <img className="Avatar"
      src={props?.author?.avatarUrl}
      alt={props?.author?.name}
    />
  );
}
function UserInfo(props) {
  return (
    <div className="UserInfo">
      <Avatar author={props.author} />
      <div className="UserInfo-name">
        {props.author.name}
      </div>
    </div>
  )
}
Comment.defaultProps = data
export default Comment